package me.bcloud.web.servlet.manager;

import java.io.IOException;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;

import me.bcloud.web.spring.Cache;

@Controller
public class StateServlet extends HttpServlet {

	
	private static final long serialVersionUID = 1L;
	@Resource
	private Cache cache;
	
	public void setCache(Cache cache) {
		this.cache = cache;
	}
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		
		request.setAttribute("cache", cache.getCacheMap());
		
		request.setAttribute("workmap", cache.getWorkMap());
		
		response.sendRedirect(getServletContext().getContextPath()
				+ "/manager/state.jsp");

	}
	
	
}
